<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>三元表达式</title>
    </head>
    <body>
        <script>
            var time = prompt('请输入数字');
            var result = time < 10 ? '0'+time : time;
            console.log('====>',result);
        </script>
    </body>
</html>